home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / libelf / elf_update.z / elf_update
Encoding:
Text File  |  1998-10-30  |  14.5 KB  |  236 lines

  1.  
  2.  
  3.  
  4. EEEELLLLFFFF____UUUUPPPPDDDDAAAATTTTEEEE((((3333EEEE))))                                                  EEEELLLLFFFF____UUUUPPPPDDDDAAAATTTTEEEE((((3333EEEE))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee - update an ELF descriptor
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _cccc_cccc [_f_l_a_g ...] _f_i_l_e ...  _----_llll_eeee_llll_ffff [_l_i_b_r_a_r_y ...]
  13.  
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_llll_iiii_bbbb_eeee_llll_ffff_...._hhhh_>>>>
  15.      _oooo_ffff_ffff______tttt _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee_((((_EEEE_llll_ffff _****_eeee_llll_ffff_,,,, _EEEE_llll_ffff______CCCC_mmmm_dddd _cccc_mmmm_dddd_))))_;;;;
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee causes the library to examine the information associated with
  19.      an ELF descriptor, _e_l_f, and to recalculate the structural data needed to
  20.      generate the file's image.
  21.  
  22.      _c_m_d may have the following values.
  23.  
  24.      _EEEE_LLLL_FFFF______CCCC______NNNN_UUUU_LLLL_LLLL      This value tells _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee to recalculate various
  25.                      values, updating only the ELF descriptor's memory
  26.                      structures.  Any modified structures are flagged with the
  27.                      _EEEE_LLLL_FFFF______FFFF______DDDD_IIII_RRRR_TTTT_YYYY bit.  A program thus can update the
  28.                      structural information and then reexamine them without
  29.                      changing the file associated with the ELF descriptor.
  30.                      Because this does not change the file, the ELF descriptor
  31.                      may allow reading, writing, or both reading and writing
  32.                      [see _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn(3E)].
  33.  
  34.      _EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE     If _c_m_d has this value, _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee duplicates its
  35.                      _EEEE_LLLL_FFFF______CCCC______NNNN_UUUU_LLLL_LLLL actions and also writes any ``dirty''
  36.                      information associated with the ELF descriptor to the
  37.                      file.  That is, when a program has used _eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa or
  38.                      the _eeee_llll_ffff______ffff_llll_aaaa_gggg facilities to supply new (or update
  39.                      existing) information for an ELF descriptor, those data
  40.                      will be examined, coordinated, translated if necessary
  41.                      [see _eeee_llll_ffff______xxxx_llll_aaaa_tttt_eeee(3E)], and written to the file.  When
  42.                      portions of the file are written, any _EEEE_LLLL_FFFF______FFFF______DDDD_IIII_RRRR_TTTT_YYYY bits
  43.                      are reset, indicating those items no longer need to be
  44.                      written to the file [see _eeee_llll_ffff______ffff_llll_aaaa_gggg(3E)].  The sections'
  45.                      data are written in the order of their section header
  46.                      entries, and the section header table is written to the
  47.                      end of the file.
  48.                      When the ELF descriptor was created with _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn, it
  49.                      must have allowed writing the file.  That is, the
  50.                      _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn command must have been either _EEEE_LLLL_FFFF______CCCC______RRRR_DDDD_WWWW_RRRR or
  51.                      _EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE.
  52.  
  53.      If _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee succeeds, it returns the total size of the file image (not
  54.      the memory image), in bytes.  Otherwise an error occurred, and the
  55.      function returns -1.
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                                                                         PPPPaaaaggggeeee 1111
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. EEEELLLLFFFF____UUUUPPPPDDDDAAAATTTTEEEE((((3333EEEE))))                                                  EEEELLLLFFFF____UUUUPPPPDDDDAAAATTTTEEEE((((3333EEEE))))
  70.  
  71.  
  72.  
  73.      When updating the internal structures, _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee sets some members
  74.      itself.  Members listed below are the application's responsibility and
  75.      retain the values given by the program.
  76.  
  77.                          Member                        Notes
  78.                    _________________________________________________________
  79.                     _eeee______iiii_dddd_eeee_nnnn_tttt_[[[[_EEEE_IIII______DDDD_AAAA_TTTT_AAAA_]]]]   Library controls other _eeee______iiii_dddd_eeee_nnnn_tttt values
  80.                     _eeee______tttt_yyyy_pppp_eeee
  81.                     _eeee______mmmm_aaaa_cccc_hhhh_iiii_nnnn_eeee
  82.                     _eeee______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn
  83.                     _eeee______eeee_nnnn_tttt_rrrr_yyyy
  84.                     _eeee______pppp_hhhh_oooo_ffff_ffff            Only when _EEEE_LLLL_FFFF______FFFF______LLLL_AAAA_YYYY_OOOO_UUUU_TTTT asserted
  85.                     _eeee______ssss_hhhh_oooo_ffff_ffff            Only when _EEEE_LLLL_FFFF______FFFF______LLLL_AAAA_YYYY_OOOO_UUUU_TTTT asserted
  86.                     _eeee______ffff_llll_aaaa_gggg_ssss
  87.        ELF Header   _eeee______ssss_hhhh_ssss_tttt_rrrr_nnnn_dddd_xxxx
  88.                    _________________________________________________________
  89.                                      |||||||||||
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.                                Member               Notes
  103.                              ________________________________________
  104.                               _pppp______tttt_yyyy_pppp_eeee     The application controls all
  105.                               _pppp______oooo_ffff_ffff_ssss_eeee_tttt   program header entries
  106.                               _pppp______vvvv_aaaa_dddd_dddd_rrrr
  107.                               _pppp______pppp_aaaa_dddd_dddd_rrrr
  108.                               _pppp______ffff_iiii_llll_eeee_ssss_zzzz
  109.                               _pppp______mmmm_eeee_mmmm_ssss_zzzz
  110.                               _pppp______ffff_llll_aaaa_gggg_ssss
  111.              Program Header   _pppp______aaaa_llll_iiii_gggg_nnnn
  112.                              ________________________________________
  113.                                        ||||||||||
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.                               Member                   Notes
  126.                           _______________________________________________
  127.                            _ssss_hhhh______nnnn_aaaa_mmmm_eeee
  128.                            _ssss_hhhh______tttt_yyyy_pppp_eeee
  129.                            _ssss_hhhh______ffff_llll_aaaa_gggg_ssss
  130.                            _ssss_hhhh______aaaa_dddd_dddd_rrrr
  131.                            _ssss_hhhh______oooo_ffff_ffff_ssss_eeee_tttt      Only when _EEEE_LLLL_FFFF______FFFF______LLLL_AAAA_YYYY_OOOO_UUUU_TTTT asserted
  132.                            _ssss_hhhh______ssss_iiii_zzzz_eeee        Only when _EEEE_LLLL_FFFF______FFFF______LLLL_AAAA_YYYY_OOOO_UUUU_TTTT asserted
  133.                            _ssss_hhhh______llll_iiii_nnnn_kkkk
  134.                            _ssss_hhhh______iiii_nnnn_ffff_oooo
  135.                            _ssss_hhhh______aaaa_dddd_dddd_rrrr_aaaa_llll_iiii_gggg_nnnn   Only when _EEEE_LLLL_FFFF______FFFF______LLLL_AAAA_YYYY_OOOO_UUUU_TTTT asserted
  136.           Section Header   _ssss_hhhh______eeee_nnnn_tttt_ssss_iiii_zzzz_eeee
  137.                           _______________________________________________
  138.                                         ||||||||||||
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.                                                                         PPPPaaaaggggeeee 2222
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165. EEEELLLLFFFF____UUUUPPPPDDDDAAAATTTTEEEE((((3333EEEE))))                                                  EEEELLLLFFFF____UUUUPPPPDDDDAAAATTTTEEEE((((3333EEEE))))
  166.  
  167.  
  168.  
  169.                               Member                  Notes
  170.                             ____________________________________________
  171.                              _dddd______bbbb_uuuu_ffff
  172.                              _dddd______tttt_yyyy_pppp_eeee
  173.                              _dddd______ssss_iiii_zzzz_eeee
  174.                              _dddd______oooo_ffff_ffff       Only when _EEEE_LLLL_FFFF______FFFF______LLLL_AAAA_YYYY_OOOO_UUUU_TTTT asserted
  175.                              _dddd______aaaa_llll_iiii_gggg_nnnn
  176.            Data Descriptor   _dddd______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn
  177.                             ____________________________________________
  178.                                        ||||||||
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.      Note the program is responsible for two particularly important members
  188.      (among others) in the ELF header.  The _eeee______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn member controls the
  189.      version of data structures written to the file.  If the version is
  190.      _EEEE_VVVV______NNNN_OOOO_NNNN_EEEE, the library uses its own internal version.  The _eeee______iiii_dddd_eeee_nnnn_tttt_[[[[_EEEE_IIII______DDDD_AAAA_TTTT_AAAA_]]]]
  191.      entry controls the data encoding used in the file.  As a special case,
  192.      the value may be _EEEE_LLLL_FFFF_DDDD_AAAA_TTTT_AAAA_NNNN_OOOO_NNNN_EEEE to request the native data encoding for the
  193.      host machine.  An error occurs in this case if the native encoding
  194.      doesn't match a file encoding known by the library.
  195.  
  196.      Further note that the program is responsible for the _ssss_hhhh______eeee_nnnn_tttt_ssss_iiii_zzzz_eeee section
  197.      header member.  Although the library sets it for sections with known
  198.      types, it cannot reliably know the correct value for all sections.
  199.      Consequently, the library relies on the program to provide the values for
  200.      unknown section type.  If the entry size is unknown or not applicable,
  201.      the value should be set to zero.
  202.  
  203.      When deciding how to build the output file, _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee obeys the
  204.      alignments of individual data buffers to create output sections.  A
  205.      section's most strictly aligned data buffer controls the section's
  206.      alignment.  The library also inserts padding between buffers, as
  207.      necessary, to ensure the proper alignment of each buffer.
  208.  
  209. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  210.      _eeee_llll_ffff(3E), _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn(3E), _eeee_llll_ffff______ffff_llll_aaaa_gggg(3E), _eeee_llll_ffff______ffff_ssss_iiii_zzzz_eeee(3E), _eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa(3E),
  211.      _eeee_llll_ffff______gggg_eeee_tttt_eeee_hhhh_dddd_rrrr(3E), _eeee_llll_ffff______gggg_eeee_tttt_ssss_hhhh_dddd_rrrr(3E), _eeee_llll_ffff______xxxx_llll_aaaa_tttt_eeee(3E).
  212.  
  213. NNNNOOOOTTTTEEEE
  214.      As mentioned above, the _EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE command translates data as necessary,
  215.      before writing them to the file.  This translation is _n_o_t always
  216.      transparent to the application program.  If a program has obtained
  217.      pointers to data associated with a file [for example, see _eeee_llll_ffff______gggg_eeee_tttt_eeee_hhhh_dddd_rrrr(3E)
  218.      and _eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa(3E)], the program should reestablish the pointers after
  219.      calling _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee.
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.                                                                         PPPPaaaaggggeeee 3333
  231.  
  232.  
  233.  
  234.